<!DOCTYPE html>
<html lang="zh">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>euv-demo-问卷</title>
</head>
<body>
    <header>
        <img src="../favicon.png" alt="">
        <h2 style="margin: auto 0;">CYue问卷</h2>
        <nav class="header-nav">
            <ul class="nav-menu">
                <li>
                    <a href="../index.html">首页</a>
                </li>
            </ul>
        </nav>
    </header>

    <div id="app">
        <dialog ref="dialog" aria-modal="true">
            <div style="width: 100%;">
                <div style="margin-bottom: 1em;text-align: right;">
                    <button class="button danger" @click="关闭历史提交">X</button>
                </div>
                <table>
                    <thead>
                        <th>姓名</th>
                        <th>性别</th>
                        <th>年龄</th>
                        <th>联系电话</th>
                    </thead>
                    <tbody>
                        <tr e-for="item in 历史提交">
                            <td>{{ item.name }}</td>
                            <td>{{ item.gender }}</td>
                            <td>{{ item.age }}</td>
                            <td>{{ item.phone }}</td>
                        </tr>
                    </tbody>
                </table>
            </div>
        </dialog>

        <div class="card" style="margin: 5% 12.5%;">
            <img class="card-header" src="../images/header.png" alt="">
            <div style="margin: 2em;">
                <h2 class="text-center">{{ wj.title }}</h2>
                <div style="margin: 2em;">
                    <!-- <p>活动主题：请在此添加活动主题</p>
                    <p>活动时间：202X年X月X日，上午X点</p>
                    <p>活动地点：天安门</p> -->
                    <p>
                        {{ wj.description }}
                    </p>
                </div>
                <form class="form" @submit="submit问卷">
                    <div>
                        <h3>01 姓名</h3>
                        <div>
                            <input
                                type="text"
                                required
                                pattern="[^0-9]{2,}"
                                e-model:value="formData.name"
                            >
                            <span></span>
                            <span></span>
                        </div>
                    </div>

                    <div>
                        <h3>02 性别</h3>
                        <div>
                            <select name="gender" e-model:value="formData.gender" required>
                                <option value="">请选择性别</option>
                                <option value="男">男</option>
                                <option value="女">女</option>
                                <option value="其他">其他</option>
                            </select>
                            <span></span>
                        </div>
                    </div>
                    <div>
                        <h3>03 年龄</h3>
                        <div>
                            <input type="number" required e-model:value="formData.age">
                            <span></span>
                        </div>
                    </div>

                    <div>
                        <h3>04 联系电话</h3>
                        <div>
                            <input
                            type="tel"
                            required
                            pattern="^(13[0-9]|14[01456879]|15[0-35-9]|16[2567]|17[0-8]|18[0-9]|19[0-35-9])\d{8}$"
                            e-model:value="formData.phone"
                            >
                            <span></span>
                            <span></span>
                        </div>
                    </div>

                    <div class="flex-row gap-1rem" style="align-self: center;margin-top: 2em;">
                        <input class="button primary" type="submit" value="提交">
                        <input class="button" type="button" value="查看历史提交" @click="查看历史提交">
                        <input class="button" type="button" value="清空历史" @click="清空历史">
                    </div>
                </form>
            </div>
        </div>

    </div>


    <footer>
        <div class="width-80 text-right">
            <p>
                QQ：
                <span>1484205856</span>
            </p>
            <p>
                手机号：
                <span>13071580229</span>
            </p>
            <p>
                作者邮箱：
                <span>hongweifei@cyue.net</span>
            </p>
        </div>
        <div>
            <p style="margin-top: 0;">&copy; 2024 洪炜斐</p>
        </div>
    </footer>
</body>
</html>


